﻿@{
    string pointId = ViewBag.pointId;
    string cdate = DateTimeHelper.FormatDate(DateTime.Now.Date);
    string time = "";
    int pageRefreshTime = ViewBag.PageRefreshTime;
}
<div class="module-container">
    <div class="search-panel">
        <form class="form-inline search-table">
            <div class="form-group">
                <input class="form-control w150px" name="CarNO" type="text"
                       placeholder="请输入车牌号查询" />
            </div>
            <div class="form-group">
                <select class="form-control uiselect uiselectsubmit" name="Point"
                        data-has-text-field="false" data-width="150">
                    @Html.EmptyOption("所有稽查点")
                    @Html.CheckPointsCategoryOption(pointId)
                </select>
            </div>
            <div class="form-group">
                <select class="form-control uiselect uiselectsubmit" name="Station"
                        data-has-text-field="false" data-width="150">
                    @Html.EmptyOption("所有客运站")
                    @Html.StationCategoryOption()
                </select>
            </div>
            @*<div class="form-group">
                    <div class="input-group date w165px uidate">
                        <input class="form-control" name="startDate" type="text" value="@cdate" placeholder="请选择开始日期">
                        <span class="input-group-addon">
                            <i class="glyphicon glyphicon-th"></i>
                        </span>
                    </div>
                </div>
                <div class="form-group">
                    <div class="input-group date w165px uidate">
                        <input class="form-control" name="endDate" type="text" placeholder="请选择结束日期">
                        <span class="input-group-addon">
                            <i class="glyphicon glyphicon-th"></i>
                        </span>
                    </div>
                </div>*@
            <div class="form-group">
                <input class="form-control w100px" name="Time" type="number" value="@time"
                       placeholder="" alt="请输入筛选时间">分钟以内数据
            </div>

            <button class="btn btn-primary" type="submit">
                <i class="fa fa-search"></i> 查询
            </button>

            <a id="SyncCarExitStationemp_export" class="btn btn-default" data-url="@Url.Action("Export")">
                <i class="fa fa-share-square-o"></i> 导出
            </a>
            <a id="ManualReg_Edit" class="btn btn-success uimodal" data-url="@Url.Action("Create","ManualReg")">
                <i class="font-size-12 icon-plus"></i>人工稽查
            </a>
            <div class="form-group" style=" color:red; font-weight:800; float:right;">待稽查车辆数:<span id="sys_totalcount"></span></div>
        </form>
    </div>
    <div id="syncCarExitStation" class="uitable" data-url="@Url.Action("Grid",new { Point = pointId,Time = time })">
        @Html.Action("Grid", new { Point = pointId, Time = time })
    </div>
</div>
<script>

    $('#SyncCarExitStationemp_export').on('click', function () {
        var url = $(this).data('url') + '?' + $.param(fx.serializeForm($('.search-table')));
        window.location.href = url;
    });

    function autoRefresh() {
        var $table = $('#syncCarExitStation');
        if ($table.length > 0) {
            $table.data('uitable').reload();
        }
    }

    $('#syncCarExitStation').uitable({
        loadMask: false,
        onAfterLoad: function () {
            setTimeout(function () {
                autoRefresh();
            }, @pageRefreshTime);
        }
    });
</script>